﻿<controls:ChildWindow x:Class="TestClient.CustomFileDetail"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
	xmlns:interlink="clr-namespace:HSS.Interlink;assembly=HSS.Interlink"
	Width="400" Height="340"
	Title="CustomFileDetail">
	<Grid x:Name="LayoutRoot" Margin="2">
		<Grid.RowDefinitions>
			<RowDefinition />
			<RowDefinition Height="Auto" />
		</Grid.RowDefinitions>
		<controls:TabControl x:Name="tbcContent">
			<controls:TabItem x:Name="tbpGeneral" Header="General">
				<Grid x:Name="ResultsGrid" Background="White">

					<Grid.Resources>
						<interlink:ByteConverter x:Key="ByteConverter"/>
						<interlink:PercentageConverter x:Key="PercentageConverter"/>
						<interlink:TransferRateConverter x:Key="TransferRateConverter"/>
						<interlink:TimeConverter x:Key="TimeConverter"/>
					</Grid.Resources>

					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="10"/>
						<ColumnDefinition Width="70"/>
						<ColumnDefinition Width="*"/>
						<ColumnDefinition Width="5"/>
					</Grid.ColumnDefinitions>

					<Grid.RowDefinitions>
						<RowDefinition Height="5"/>
						<RowDefinition Height="23"/>
						<RowDefinition Height="23"/>
						<RowDefinition Height="23"/>
						<RowDefinition Height="23"/>
						<RowDefinition Height="23"/>
						<RowDefinition Height="28"/>
						<RowDefinition Height="75"/>
						<RowDefinition Height="5"/>
					</Grid.RowDefinitions>

					<TextBlock Grid.Row="1" Grid.Column="1" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left" Text="File:" FontWeight="Bold" />
					<TextBlock Grid.Row="1" Grid.Column="2" Margin="5" VerticalAlignment="Center" Text="{Binding FileName}" />

					<TextBlock Grid.Row="2" Grid.Column="1" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left" Text="State:" FontWeight="Bold" />
					<TextBlock Grid.Row="2" Grid.Column="2" Margin="5" VerticalAlignment="Center" Text="{Binding State}" />

					<TextBlock Grid.Row="3" Grid.Column="1" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left" Text="Bytes:" FontWeight="Bold" />
					<StackPanel Orientation="Horizontal" Grid.Row="3" Grid.Column="2" Margin="5" >
						<TextBlock VerticalAlignment="Center" Text="{Binding BytesUploaded, Converter={StaticResource ByteConverter}}" />
						<TextBlock VerticalAlignment="Center" Text=" of " />
						<TextBlock VerticalAlignment="Center" Text="{Binding FileLength, Converter={StaticResource ByteConverter}}" />
					</StackPanel >

					<TextBlock Grid.Row="4" Grid.Column="1" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left" Text="Elapsed:" FontWeight="Bold" />
					<TextBlock Grid.Row="4" Grid.Column="2" Margin="5" VerticalAlignment="Center" Text="{Binding ElapsedTime, Converter={StaticResource TimeConverter}}" />

					<TextBlock Grid.Row="5" Grid.Column="1" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left" Text="Rate:" FontWeight="Bold" />
					<TextBlock Grid.Row="5" Grid.Column="2" Margin="5" VerticalAlignment="Center" Text="{Binding TransferRate, Converter={StaticResource TransferRateConverter}}" />

					<TextBlock Grid.Row="6" Grid.Column="1" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left" Text="Progress:" FontWeight="Bold" />
					<Grid Grid.Row="6" Grid.Column="2" Margin="5">
						<ProgressBar Value="{Binding Percentage}" HorizontalAlignment="Stretch"/>
						<TextBlock Text="{Binding Percentage, Converter={StaticResource PercentageConverter}}" TextAlignment="Center"/>
					</Grid>

					<TextBlock Grid.Row="7" Grid.Column="1" Margin="5" VerticalAlignment="Top" HorizontalAlignment="Left" Text="Errors:" FontWeight="Bold" />
					<TextBox Grid.Row="7" Grid.Column="2" Margin="5" VerticalAlignment="Stretch" Text="{Binding LastException}" Foreground="Brown" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled" TextWrapping="Wrap" IsReadOnly="True" />

				</Grid>
			</controls:TabItem>
			<controls:TabItem x:Name="tbpCustom" Header="Custom Metadata">
				<StackPanel>
					<StackPanel Orientation="Horizontal" Margin="4">
						<TextBlock Text="Tag: " Width="100" VerticalAlignment="Center"/>
						<TextBox x:Name="txtTag" Width="250"/>
					</StackPanel>
					<StackPanel Orientation="Horizontal" Margin="4">
						<TextBlock Text="Comment: " Width="100" VerticalAlignment="Top"/>
						<TextBox x:Name="txtComment" Width="250" Height="100"/>
					</StackPanel>
				</StackPanel>
			</controls:TabItem>
		</controls:TabControl>
		<Button x:Name="btnCancel" Content="Cancel" Click="btnCancel_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,0,0" Grid.Row="1" />
		<Button x:Name="OKButton" Content="OK" Click="OKButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,79,0" Grid.Row="1" />
	</Grid>
</controls:ChildWindow>